<script type="text/javascript">
<!--
{literal}
    $(document).ready(function(){
        $('table#serTbl tr:even').addClass('alt');
    });

    function viewCashierTestTicketDetail(testDiagnosisTicketId) {
    	$.ajax({
            type:       "GET",
            url:        "../TicketTest/ViewPatientTestDetailAjax?set_ajax_view",
            data:       "testDiagnosisTicketId=" + testDiagnosisTicketId,     
            dataType:   "json",
            success:    function(data) {
            if (data.error.code ==  'OK') {

                var buttons = {};
                buttons[_('Close')] = function() {
                    $(this).dialog('close');        
                }; 
                generalDialog(null,_("Test Detail"),data.result,null,{
                    autoOpen: true,         
                    bgiframe: true,
                    resizable: false,
                    modal: true,    
                    width: 780,
                    height: 400,
                    buttons: buttons
                });
            } else {
                displayError(data.error.mess);
            }
        }
        });
    }
{/literal}    
//-->
</script>
<table id="serTbl" class="grid" width="800px;" cellpadding="0" cellspacing="0">
    <thead>
        <tr>
            <th class="first" width="20">{translate}No.{/translate}</th>
            <th width="150">{translate}Test{/translate}</th>
            <th>{translate}Department{/translate}</th>
            <th width="90">{translate}Price{/translate}</th>
            <th width="60">{translate}Insurance payment{/translate}</th>
            <th width="60">{translate}Patient payment_1{/translate}</th>
            <th class="last">{translate}Doctor{/translate}</th>
        </tr>
    </thead>
    <tbody>
    {assign var="count" value=1} 
    {if !empty($listTestTicketInfo)}
    {foreach from=$listTestTicketInfo item=testTicket}
        <tr>
            <td class="first">{$count++}</td>            
            <td><a href="javascript:viewCashierTestTicketDetail('{$testTicket.test_diagnosis_ticket_id}')">{$testTicket.requested_time}</a></td>
            <td>{$testTicket.department_name}</td>
            <td>{$testTicket.original_price}</td>
            <td>{$testTicket.insurance_price}</td>
            <td>{$testTicket.patient_price}</td>             
            <td class="last">{$testTicket.doctor}</td>
        </tr>
    {/foreach}
            <tr>
            <td class="first" colspan="3" align="right"><span style="color: red; font-weight: bold">{translate}Total{/translate}</span></td>
            <td><span style="color: red; font-weight: bold">{$total.original_price}</span></td>
            <td><span style="color: red; font-weight: bold">{$total.insurance_price}</span></td>
            <td ><span style="color: red; font-weight: bold">{$total.patient_price}</span></td>
            <td class="last"></td>
            </tr>
    {else}
        <tr><td colspan="8" class="first last">{translate}There is no information on test services the patient has used{/translate}</td>
    {/if}
    </tbody>
</table>